
require('./common');


exports.load = function(req, res){
	
	var id = req.params.id;
	var fieldName;
	var fieldValue;
	
	if(id=="0"){
		var strSQL = "SELECT * FROM user ORDER BY Last_Name ";
	}else{
		var strSQL = "SELECT * FROM user WHERE ID=" + conn.escape(id) +" ORDER BY Last_Name ";
	}
	
	conn.query(strSQL, function(err, results, fields){
		if(err) throw err;
			var users = [];
			users = results;
			
			
			res.send(users);
	});

}
